﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Maticsoft.Web.Default" %>
<%@ Register Src="Controls/eMeng.ascx" TagName="eMeng" TagPrefix="uc3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<%@ Register Src="Controls/copyright.ascx" TagName="copyright" TagPrefix="uc2" %>
<%@ Register Src="Controls/header.ascx" TagName="header" TagPrefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <link rel="stylesheet" type="text/css" href="css/main.css"  media="screen" />
    <script src="js/showflash.js" type="text/javascript"></script>
	<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
	<script  src="js/scrollnews.js" type="text/javascript"></script>
	<script type="text/javascript" src="js/jquery.flash.js"></script>
	
	<script>

var isIE = (document.all) ? true : false;

var $ = function (id) {
	return "string" == typeof id ? document.getElementById(id) : id;
};

var Class = {
	create: function() {
		return function() { this.initialize.apply(this, arguments); }
	}
}

var Extend = function(destination, source) {
	for (var property in source) {
		destination[property] = source[property];
	}
}

var Bind = function(object, fun) {
	var args = Array.prototype.slice.call(arguments).slice(2);
	return function() {
		return fun.apply(object, args);
	}
}

var BindAsEventListener = function(object, fun) {
	return function(event) {
		return fun.call(object, Event(event));
	}
}

function Event(e){
	var oEvent = isIE ? window.event : e;
	if (isIE) {
		oEvent.pageX = oEvent.clientX + document.documentElement.scrollLeft;
		oEvent.pageY = oEvent.clientY + document.documentElement.scrollTop;
		oEvent.preventDefault = function () { this.returnValue = false; };
		oEvent.detail = oEvent.wheelDelta / (-40);
		oEvent.stopPropagation = function(){ this.cancelBubble = true; }; 
	}
	return oEvent;
}

var CurrentStyle = function(element){
	return element.currentStyle || document.defaultView.getComputedStyle(element, null);
}

function addEventHandler(oTarget, sEventType, fnHandler) {
	if (oTarget.addEventListener) {
		oTarget.addEventListener(sEventType, fnHandler, false);
	} else if (oTarget.attachEvent) {
		oTarget.attachEvent("on" + sEventType, fnHandler);
	} else {
		oTarget["on" + sEventType] = fnHandler;
	}
};

function removeEventHandler(oTarget, sEventType, fnHandler) {
    if (oTarget.removeEventListener) {
        oTarget.removeEventListener(sEventType, fnHandler, false);
    } else if (oTarget.detachEvent) {
        oTarget.detachEvent("on" + sEventType, fnHandler);
    } else { 
        oTarget["on" + sEventType] = null;
    }
};


//滑动条程序
var Slider = Class.create();
Slider.prototype = {
  //容器对象，滑块
  initialize: function(container, bar, options) {
	this.Bar = $(bar);
	this.Container = $(container);
	this._timer = null;//自动滑移的定时器
	this._ondrag = false;//解决ie的click问题
	//是否最小值、最大值、中间值
	this._IsMin = this._IsMax = this._IsMid = false;
	//实例化一个拖放对象，并限定范围
	this._drag = new Drag(this.Bar, { Limit: true, mxContainer: this.Container,
		onStart: Bind(this, this.DragStart), onStop: Bind(this, this.DragStop), onMove: Bind(this, this.Move)
	});
	
	this.SetOptions(options);
	
	this.WheelSpeed = Math.max(0, this.options.WheelSpeed);
	this.KeySpeed = Math.max(0, this.options.KeySpeed);
	
	this.MinValue = this.options.MinValue;
	this.MaxValue = this.options.MaxValue;
	
	this.RunTime = Math.max(1, this.options.RunTime);
	this.RunStep = Math.max(1, this.options.RunStep);
	
	this.Ease = !!this.options.Ease;
	this.EaseStep = Math.max(1, this.options.EaseStep);
	
	this.onMin = this.options.onMin;
	this.onMax = this.options.onMax;
	this.onMid = this.options.onMid;
	
	this.onDragStart = this.options.onDragStart;
	this.onDragStop = this.options.onDragStop;
	
	this.onMove = this.options.onMove;
	
	this._horizontal = !!this.options.Horizontal;//一般不允许修改
	
	//锁定拖放方向
	this._drag[this._horizontal ? "LockY" : "LockX"] = true;
	
	//点击控制
	addEventHandler(this.Container, "click", BindAsEventListener(this, function(e){ this._ondrag || this.ClickCtrl(e);}));
	//取消冒泡，防止跟Container的click冲突
	addEventHandler(this.Bar, "click", BindAsEventListener(this, function(e){ e.stopPropagation(); }));
	
	//设置鼠标滚轮控制
	this.WheelBind(this.Container);
	//设置方向键控制
	this.KeyBind(this.Container);
	//修正获取焦点
	var oFocus = isIE ? (this.KeyBind(this.Bar), this.Bar) : this.Container;
	addEventHandler(this.Bar, "mousedown", function(){ oFocus.focus(); });
	//ie鼠标捕获和ff的取消默认动作都不能获得焦点，所以要手动获取
	//如果ie把focus设置到Container，那么在出现滚动条时ie的focus可能会导致自动滚屏
  },
  //设置默认属性
  SetOptions: function(options) {
	this.options = {//默认值
		MinValue:	0,//最小值
		MaxValue:	100,//最大值
		WheelSpeed: 5,//鼠标滚轮速度,越大越快(0则取消鼠标滚轮控制)
		KeySpeed: 	50,//方向键滚动速度,越大越慢(0则取消方向键控制)
		Horizontal:	true,//是否水平滑动
		RunTime:	20,//自动滑移的延时时间,越大越慢
		RunStep:	2,//自动滑移每次滑动的百分比
		Ease:		false,//是否缓动
		EaseStep:	5,//缓动等级,越大越慢
		onMin:		function(){},//最小值时执行
		onMax:		function(){},//最大值时执行
		onMid:		function(){},//中间值时执行
		onDragStart:function(){},//拖动开始时执行
		onDragStop:	function(){},//拖动结束时执行
		onMove:		function(){}//滑动时执行
	};
	Extend(this.options, options || {});
  },
  //开始拖放滑动
  DragStart: function() {
  	this.onDragStart();
	this._ondrag = true;
  },
  //结束拖放滑动
  DragStop: function() {
  	this.onDragStop();
	setTimeout(Bind(this, function(){ this._ondrag = false; }), 10);
  },
  //滑动中
  Move: function() {
  	this.onMove();
	
	var percent = this.GetPercent();
	//最小值判断
	if(percent > 0){
		this._IsMin = false;
	}else{
		if(!this._IsMin){ this.onMin(); this._IsMin = true; }
	}
	//最大值判断
	if(percent < 1){
		this._IsMax = false;
	}else{
		if(!this._IsMax){ this.onMax(); this._IsMax = true; }
	}
	//中间值判断
	if(percent > 0 && percent < 1){
		if(!this._IsMid){ this.onMid(); this._IsMid = true; }
	}else{
		this._IsMid = false;
	}
  },
  //鼠标点击控制
  ClickCtrl: function(e) {
	var o = this.Container, iLeft = o.offsetLeft, iTop = o.offsetTop;
	while (o.offsetParent) { o = o.offsetParent; iLeft += o.offsetLeft; iTop += o.offsetTop; }
	//考虑有滚动条，要用pageX和pageY
	this.EasePos(e.pageX - iLeft - this.Bar.offsetWidth / 2, e.pageY - iTop - this.Bar.offsetHeight / 2);
  },
  //鼠标滚轮控制
  WheelCtrl: function(e) {
	var i = this.WheelSpeed * e.detail;
	this.SetPos(this.Bar.offsetLeft + i, this.Bar.offsetTop + i);
	//防止触发其他滚动条
	e.preventDefault();
  },
  //绑定鼠标滚轮
  WheelBind: function(o) {
  	//鼠标滚轮控制
	addEventHandler(o, isIE ? "mousewheel" : "DOMMouseScroll", BindAsEventListener(this, this.WheelCtrl));
  },
  //方向键控制
  KeyCtrl: function(e) {
	if(this.KeySpeed){
		var iLeft = this.Bar.offsetLeft, iWidth = (this.Container.clientWidth - this.Bar.offsetWidth) / this.KeySpeed
			, iTop = this.Bar.offsetTop, iHeight = (this.Container.clientHeight - this.Bar.offsetHeight) / this.KeySpeed;
		//根据按键设置值
		switch (e.keyCode) {
			case 37 ://左
				iLeft -= iWidth; break;
			case 38 ://上
				iTop -= iHeight; break;
			case 39 ://右
				iLeft += iWidth; break;
			case 40 ://下
				iTop += iHeight; break;
			default :
				return;//不是方向按键返回
		}
		this.SetPos(iLeft, iTop);
		//防止触发其他滚动条
		e.preventDefault();
	}
  },
  //绑定方向键
  KeyBind: function(o) {
	addEventHandler(o, "keydown", BindAsEventListener(this, this.KeyCtrl));
	//设置tabIndex使设置对象能支持focus
	o.tabIndex = -1;
	//取消focus时出现的虚线框
	isIE || (o.style.outline = "none");
  },
  //获取当前值
  GetValue: function() {
	//根据最大最小值和滑动百分比取值
	return this.MinValue + this.GetPercent() * (this.MaxValue - this.MinValue);
  },
  //设置值位置
  SetValue: function(value) {
	//根据最大最小值和参数值设置滑块位置
	this.SetPercent((value- this.MinValue)/(this.MaxValue - this.MinValue));
  },
  //获取百分比
  GetPercent: function() {
	//根据滑动条滑块取百分比
	return this._horizontal ? this.Bar.offsetLeft / (this.Container.clientWidth - this.Bar.offsetWidth)
		: this.Bar.offsetTop / (this.Container.clientHeight - this.Bar.offsetHeight)
  },
  //设置百分比位置
  SetPercent: function(value) {
	//根据百分比设置滑块位置
	this.EasePos((this.Container.clientWidth - this.Bar.offsetWidth) * value, (this.Container.clientHeight - this.Bar.offsetHeight) * value);
  },
  //自动滑移(是否递增)
  Run: function(bIncrease) {
	this.Stop();
	//修正一下bIncrease
	bIncrease = !!bIncrease;
	//根据是否递增来设置值
	var percent = this.GetPercent() + (bIncrease ? 1 : -1) * this.RunStep / 100;
	this.SetPos((this.Container.clientWidth - this.Bar.offsetWidth) * percent, (this.Container.clientHeight - this.Bar.offsetHeight) * percent);
	//如果没有到极限值就继续滑移
	if(!(bIncrease ? this._IsMax : this._IsMin)){
		this._timer = setTimeout(Bind(this, this.Run, bIncrease), this.RunTime);
	}
  },
  //停止滑移
  Stop: function() {
	clearTimeout(this._timer);
  },
  //缓动滑移
  EasePos: function(iLeftT, iTopT) {
	this.Stop();
	//必须是整数，否则可能死循环
	iLeftT = Math.round(iLeftT); iTopT = Math.round(iTopT);
	//如果没有设置缓动
	if(!this.Ease){ this.SetPos(iLeftT, iTopT); return; }
	//获取缓动参数
	var iLeftN = this.Bar.offsetLeft, iLeftS = this.GetStep(iLeftT, iLeftN)
	, iTopN = this.Bar.offsetTop, iTopS = this.GetStep(iTopT, iTopN);
	//如果参数有值
	if(this._horizontal ? iLeftS : iTopS){
		//设置位置
		this.SetPos(iLeftN + iLeftS, iTopN + iTopS);
		//如果没有到极限值则继续缓动
		if(this._IsMid){ this._timer = setTimeout(Bind(this, this.EasePos, iLeftT, iTopT), this.RunTime); }
	}
  },
  //获取步长
  GetStep: function(iTarget, iNow) {
    var iStep = (iTarget - iNow) / this.EaseStep;
    if (iStep == 0) return 0;
    if (Math.abs(iStep) < 1) return (iStep > 0 ? 1 : -1);
    return iStep;
  },
  //设置滑块位置
  SetPos: function(iLeft, iTop) {
	this.Stop();
	this._drag.SetPos(iLeft, iTop);
  }
};
</script>
<script type="text/javascript" src="js/Drag.js"></script>	
</head>
<body>
    <uc1:header id="Header1" runat="server">
    </uc1:header>
    <div id="content">
        <div id="body-content">
			  <div style="clear: both;"></div>
			  <div class="left">
                   <div class="new-title">
                            <div class="header">新闻纵横</div>
                            <div  id="news_more" >
                                    <ul class="more">
                                        <li class="m1">
	                                              <a href="search.aspx?search_text=" title="查找更多新闻..." hidefocus="" target="_self"></a>
                                        </li>
                                    </ul> 
                            </div>
                    </div>
                    <div class="new-list">
                        <div class="new-img">
                            <img src="images/news.gif"/>
                        </div>
                        <asp:Repeater ID="leftNewsRepeater" runat="server" OnItemDataBound="LeftNews_ItemDataBound">
                            <HeaderTemplate> <ul class="newslist"></HeaderTemplate>
                            <ItemTemplate><li>
                                <asp:Label ID="createDate" runat="server" Text=""></asp:Label><asp:HyperLink ID="leftNewHyperLink" runat="server"><%# Eval("Focus").ToString()%></asp:HyperLink></li>
                            </ItemTemplate>
                            <FooterTemplate></ul></FooterTemplate>
                        </asp:Repeater>
                    </div>
                    <div class="new-title1">
                        <div class="header">集团产业</div>
                        <div id="company_more">
                                <ul class="more">
                                    <li class="m1">
                                              <a href="company.aspx?menu_parm=3&nav_one=0&nav_two=0" title="查找更多新闻..." hidefocus="" target="_self"></a>
                                    </li>
                                </ul> 
                        </div>
                    </div>
                   <div id="idContainer" class="container">
                        
                      <div id="idContent" class="content">
                        <table cellpadding="0" cellspacing="0">
                          <tbody><tr align="center">
                            <td><div class="por-list"><a href="company.aspx?menu_parm=3&nav_one=27&nav_two=0" target=_self><img src="Images/fangdichan1.jpg"></a><span>房地产公司</span>房地产公司...</div></td>
                            <td><div class="por-list"><a href="company.aspx?menu_parm=3&nav_one=30&nav_two=0" target=_self><img src="Images/tuliao.JPG"></a><span>建筑涂料公司</span>建筑涂料公司...</div></td>
                            <td><div class="por-list"><a href="company.aspx?menu_parm=3&nav_one=28&nav_two=0" target=_self><img src="Images/nongye.jpg"></a><span>农业开发公司</span>农业开发公司...</div></td>
                            <td><div class="por-list"><a href="company.aspx?menu_parm=3&nav_one=29&nav_two=0" target=_self><img src="Images/luqiao.jpg"></a><span>路桥公司</span>路桥公司...</div></td>
                            <td><div class="por-list"><a href="company.aspx?menu_parm=3&nav_one=31&nav_two=0" target=_self><img src="Images/daikuan.JPG"></a><span>小额贷款公司</span>小额贷款公司...</div></td>
                          </tr>
                        </tbody></table>
                      </div>
                      <div  class="slider_left" id="idSliderLeft"></div>
                      <div  class="slider" id="idSlider">
                        <div   class="bar" id="idBar">
                          <div class="bar_left"></div>
                          <div class="bar_right"></div>
                        </div>
                      </div>
                      <div class="slider_right" id="idSliderRight"></div>
                       <script>
                        var sld = new Slider("idSlider", "idBar", {
	                        MaxValue: $("idContent").scrollWidth - $("idContent").clientWidth,
	                        onMin: function(){ $("idSliderLeft").style.backgroundPosition = "bottom left"; },
	                        onMax: function(){ $("idSliderRight").style.backgroundPosition = "bottom right"; },
	                        onMid: function(){ $("idSliderLeft").style.backgroundPosition = "top left"; $("idSliderRight").style.backgroundPosition = "top right"; },
	                        onMove: function(){ $("idContent").scrollLeft = this.GetValue(); }
                        });
                        sld.SetPercent(.5);
                        sld.Ease = true;

                        $("idSliderLeft").onmouseover = function(){ sld.Run(false); }
                        $("idSliderLeft").onmouseout = function(){ sld.Stop(); }

                        $("idSliderRight").onmouseover = function(){ sld.Run(true); }
                        $("idSliderRight").onmouseout = function(){ sld.Stop(); }
                       
                      </script>
		           </div> 
			  </div>
		      <div class="home-right"> 
                    <div class="right-title">
                        <span id="ctl00_ContentPlaceHolder1_lbJob">最新动态</span>
                    </div>
                     <div class="right-bg">
                        <div class="right-list">
                            <asp:Repeater ID="newsListRepeater" runat="server" OnItemDataBound="NewsList_ItemDataBound">
                            <HeaderTemplate><div id="scrollDiv"><ul></HeaderTemplate>
                            <ItemTemplate><li><asp:HyperLink ID="newHyperLink" runat="server"><%# FormatString(Eval("Heading").ToString(),16)%></asp:HyperLink></li>
                            </ItemTemplate><FooterTemplate></ul></div></FooterTemplate></asp:Repeater>
                            <div class="clear"><img src="images/h.gif"></div>
                             <div class="book">
                             <script type="text/javascript" language="JavaScript">
                                var imgUrl3196=new Array();
                                var imgLink3196=new Array();
                                var imgText3196=new Array();
                                var count =0;
                                var focus_width=235;
                                var focus_height=140;
                                var text_height=0;
                                var swf_height = focus_height+text_height;
                               
                               <% if (null != newsDataTable)
                                { 
                                 int rowsCount = newsDataTable.Rows.Count;
                                %>
                                count=<%= rowsCount %>;
                                <%
                                 
                                   if (rowsCount > 0)
                                    {
                                      for (int n = 0; n < rowsCount; n++)
                                        {
                                %>
                                imgUrl3196[<%=n+1 %>] = "ProductImages/<%=newsDataTable.Rows[n]["Image"].ToString() %>";
                                imgLink3196[<%=n+1 %>] = "<%=createImageNewsHref(newsDataTable.Rows[n]["NewsId"].ToString()) %>";
                                imgText3196[<%=n+1 %>] = "<%=newsDataTable.Rows[n]["Heading"].ToString() %>";    
                                <% }
                                }
                                }
                                %>
                                var j=0;
                                for (i=1;i<=count;i++) {
                                if( (imgUrl3196[i]!="") && (imgLink3196[i]!="") ) {
                                j++;
                                } else {
                                break;
                                }
                                }
                                var pics=""
                                var links=""
                                var texts=""
                                for (i=1;i<=j;i++) {
                                pics=pics+imgUrl3196[i]
                                if( (i<j)) {pics=pics+"|";} 
                                links=links+imgLink3196[i]
                                if( (i<j)) {links=links+"|";} 
                                texts=texts+imgText3196[i]
                                if( (i<j)) {texts=texts+"|";} 
                                }
                                document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
                                document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="flash/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#FFFFFF">');
                                document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
                                document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
                                document.write('<embed src="flash/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#dfdfdf" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
                                document.write('</object>');
                                //-->
                            </script> 
                        </div>
                        
                        <div class="clear"><img src="images/h.gif"></div>
                        
                        <div id="friendlink">
                            <select name="select" onchange="javascript:setTimeout('__doPostBack(\'select\',\'\')', 0)" id="select" class="friendlink">
	                            <option selected="selected" value="0">--------友情链接--------</option>
	                            <option value="http://www.aa.cc">测试</option>
	                            <option value="http://www.bb.com">测试</option>
    
                             </select>
                        </div>
                      </div>
                    </div>
		      </div>
		     
		      <div style="clear: both;"></div>
	    </div>
	</div>
    <uc2:copyright ID="Copyright1" runat="server" />
    <uc3:eMeng ID="EMeng1" runat="server" />
   </body>
</html>